<div class="form__wrapper">
  <div class="card pt-4">
    <div class="card-section">
      <div class="user-fields">
        <div class="row column">
          <%= form.select :existing_user, [[t(".non_user"), false], [t(".existing_user"), true]], label: t(".user_type") %>
        </div>

        <div class="row column user-fields--full-name">
          <%= form.text_field :full_name, autofocus: true %>
        </div>

        <div class="row column user-fields--user-picker">
          <% prompt_options = { url: decidim_admin.users_organization_url, placeholder: t(".select_user") } %>
          <%= form.autocomplete_select(:user_id, form.object.user.presence, { multiple: false }, prompt_options) do |user|
            { value: user.id, label: "#{user.name} (@#{user.nickname})" }
          end %>
        </div>
      </div>

      <div class="row column">
        <% if @form.meetings %>
          <%= form.select :conference_meeting_ids,
                          options_for_select(@form.meetings, selected: meetings_selected ),
                          { include_blank: true },
                          { multiple: true, class: "chosen-select" } %>
        <% end %>
      </div>

      <div class="row column">
        <%= form.translated :text_field, :position, aria: { label: :position } %>
      </div>

      <div class="row column">
        <%= form.translated :text_field, :affiliation, aria: { label: :affiliation } %>
      </div>

      <div class="row column">
        <%= form.translated :editor, :short_bio, aria: { label: :short_bio } %>
      </div>

      <div class="row column">
        <%= form.text_field :twitter_handle %>
      </div>

      <div class="row column">
        <%= form.url_field :personal_url %>
      </div>

      <div class="row column">
        <%= form.upload :avatar, button_class: "button button__sm button__transparent-secondary" %>
      </div>
    </div>
  </div>
</div>

<%= append_javascript_pack_tag "decidim_conferences_admin" %>
